class Xrange:
    def __init__(self, max_num):
        self.max_num = max_num

    def __iter__(self):
        count = 0
        while count < self.max_num:
            yield count
            count += 1


if __name__ == '__main__':
    xrange = Xrange(10)
    for item in xrange:
        print(item)